﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(AudioSource))]
public class AudioElement : MonoBehaviour
{
    AudioSource audioSource;
    private void Awake()
    {
        audioSource = GetComponent<AudioSource>();
    }
    private void Start()
    {
        AudioManager.Instance.Register(audioSource);
    }
    private void OnDestroy()
    {
        AudioManager.Instance.UnRegister(audioSource);
    }
}
